# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           meson 1.0

name                gdk-pixbuf2
set gname           gdk-pixbuf
epoch               2
version             2.40.0
revision            1
license             LGPL
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          graphics
maintainers         {devans @dbevans} openmaintainer
homepage            http://www.gtk.org/
platforms           darwin
distname            ${gname}-${version}
use_xz              yes

description         The gdk-pixbuf-2.0 library

long_description    ${description}

master_sites        gnome:sources/${gname}/${branch}/

checksums           rmd160  409fc37578fbf1dea2abaefa715f74280b3ea0ab \
                    sha256  1582595099537ca8ff3b99c6804350b4c058bb8ad67411bbaae024ee7cead4e6 \
                    size    5512160

depends_build-append \
                    port:pkgconfig \
                    port:gtk-doc \
                    port:libxslt

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:gettext \
                    port:gobject-introspection \
                    port:shared-mime-info \
                    port:libpng \
                    port:jasper \
                    port:jpeg \
                    port:tiff

license_noconflict  gobject-introspection

patchfiles          override-math-function-tests.patch

compiler.c_standard 1999

configure.ldflags-append -lintl

configure.args      -Dx11=false \
                    -Ddocs=true \
                    -Djasper=true

# gobject-introspection uses g-ir-scanner, which uses $CC from env
if {[variant_isset universal]} {
    foreach arch ${configure.universal_archs} {
        lappend merger_build_env(${arch})  "CC=${configure.cc} -arch ${arch}"
        lappend merger_destroot_env(${arch})  "CC=${configure.cc} -arch ${arch}"
    }
} else {
    build.env-append       "CC=${configure.cc} ${configure.cc_archflags}"
    destroot.env-append    "CC=${configure.cc} ${configure.cc_archflags}"
}

variant bundle description {Enable application bundle relocation support} {
    configure.args-append   -Drelocatable=true
}

variant x11 {
    depends_lib-append      port:xorg-libX11
    configure.args-replace  -Dx11=false -Dx11=true
}

if {![variant_isset quartz]} {
    default_variants    +x11
}

post-activate {
        system "${prefix}/bin/gdk-pixbuf-query-loaders --update-cache"
}

livecheck.type      gnome
livecheck.name      ${gname}
